package com.acsior.hibernate.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.dac.impl.hibernate.vo.HibernatePersistantIntegerIdVO;

/**
 * PostCode entity. @author MyEclipse Persistence Tools <b><i>powered by
 * Belev</i></b>
 */
@Entity
@Table(name = "post_codes")
@GeneratorKey(tableName = "post_codes")
public class PostCodeVO extends HibernatePersistantIntegerIdVO {

	private static final long serialVersionUID = 7461585672648493489L;

	@Column(name = "district", nullable = false, length = 50)
	private String district;

	@Column(name = "location", nullable = false, length = 50)
	private String location;

	@Column(name = "main", nullable = false)
	private boolean main;

	@Column(name = "municipal", nullable = false, length = 50)
	private String municipal;

	@Column(name = "post_code", nullable = false, length = 4)
	private String postCode;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "structure_id", nullable = false)
	private StructureVO structure;

	/** default constructor */
	public PostCodeVO() {
		super();
	}

	/** @return the district */
	public String getDistrict() {
		return this.district;
	}

	/** @return the location */
	public String getLocation() {
		return this.location;
	}

	/** @return the municipal */
	public String getMunicipal() {
		return this.municipal;
	}

	/** @return the postCode */
	public String getPostCode() {
		return this.postCode;
	}

	/** @return the structure */
	public StructureVO getStructure() {
		return this.structure;
	}

	/** @return the main */
	public boolean isMain() {
		return this.main;
	}

	/**
	 * @param district
	 *            the district to set
	 */
	public void setDistrict(String district) {
		this.district = district;
	}

	/**
	 * @param location
	 *            the location to set
	 */
	public void setLocation(String location) {
		this.location = location;
	}

	/**
	 * @param main
	 *            the main to set
	 */
	public void setMain(boolean main) {
		this.main = main;
	}

	/**
	 * @param municipal
	 *            the municipal to set
	 */
	public void setMunicipal(String municipal) {
		this.municipal = municipal;
	}

	/**
	 * @param postCode
	 *            the postCode to set
	 */
	public void setPostCode(String postCode) {
		this.postCode = postCode;
	}

	/**
	 * @param structure
	 *            the structure to set
	 */
	public void setStructure(StructureVO structure) {
		this.structure = structure;
	}
}